package com.gitee.chenyaohua.oa.dao;

import java.time.LocalDateTime;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.gitee.chenyaohua.oa.domain.TUser;

public interface UserRepository extends JpaRepository<TUser,String>,JpaSpecificationExecutor<TUser>  {

	
	public TUser findByUserEmail(String email);
	/**
	 * 
	 * @param userSex	
	 * @param updateDate
	 * @param userName
	 * @param userEmail
	 * @param userId
	 * @return
	 */
	@Modifying
	@Query("UPDATE TUser SET userSex = :userSex, updateDate = :updateDate,  userName = :userName,  userEmail = :userEmail,userEmail = :userEmail WHERE userId =:userId ")
	int updateByUserId( @Param("userSex") String userSex,@Param("updateDate") LocalDateTime updateDate,@Param("userName") String userName,@Param("userEmail") String userEmail,@Param("userId") String userId);
}
